"use strict"
/**
 *
 * @param {import("egg").Application} app
 */
module.exports = app => {
	const Sequelize = app.Sequelize
	const sequelize = app.model

	let Address = sequelize.define("address", {
		ip: {
			type: Sequelize.INTEGER.UNSIGNED,
			allowNull: false,
			unique: true,
			primaryKey: true,
		},
		region: {
			type: Sequelize.STRING,
		},
		city: {
			type: Sequelize.STRING,
		},
		country: {
			type: Sequelize.STRING,// undefined 中国
		}
	}, {
		tableName: "ip_address",
		timestamps: false,
		deletedAt: false
	})
	return Address
}
